// 创建外壳组件
import React, {Component} from "react"
import moment from 'moment';
import { Button, DatePicker } from 'antd';
const { RangePicker } = DatePicker;
function disabledDate(current) {
  // Can not select days before today and today
  return current && current < moment().endOf('day');
}

function range(start, end) {
  const result = [];
  for (let i = start; i < end; i++) {
    result.push(i);
  }
  return result;
}

function disabledRangeTime(_, type) {
  if (type === 'start') {
    return {
      disabledHours: () => range(0, 60).splice(24, 0), // 小时
      disabledMinutes: () => range(60, 0), // 分钟
      disabledSeconds: () => [55, 56], // 秒
    };
  }
  return {
    disabledHours: () => range(0, 60).splice(24, 0), // 小时
    disabledMinutes: () => range(60, 0), // 分钟
    disabledSeconds: () => [55, 56],
  };
}

// 创建并暴露App组件
export default class App extends Component {



  render() {
    return (
      <div>
        <Button type="primary">我是按钮</Button>
        <Button>Default Button</Button>
        <Button type="dashed">Dashed Button</Button>
        <RangePicker
          disabledDate={disabledDate}
          disabledTime={disabledRangeTime}
          showTime={{
            hideDisabledOptions: true,
            defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('11:59:59', 'HH:mm:ss')],
          }}
          format="YYYY-MM-DD HH:mm:ss"
        />
      </div>
    )
  }
}